(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0) → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0) → false
le(0, Y) → true
gcd(0, Y) → 0
gcd(s(X), 0) → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

minus(X, s(Y)) → pred(minus(X, Y)) [1]
minus(X, 0) → X [1]
pred(s(X)) → X [1]
le(s(X), s(Y)) → le(X, Y) [1]
le(s(X), 0) → false [1]
le(0, Y) → true [1]
gcd(0, Y) → 0 [1]
gcd(s(X), 0) → s(X) [1]
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y)) [1]
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y)) [1]
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X)) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

minus(X, s(Y)) → pred(minus(X, Y)) [1]
minus(X, 0) → X [1]
pred(s(X)) → X [1]
le(s(X), s(Y)) → le(X, Y) [1]
le(s(X), 0) → false [1]
le(0, Y) → true [1]
gcd(0, Y) → 0 [1]
gcd(s(X), 0) → s(X) [1]
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y)) [1]
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y)) [1]
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X)) [1]

The TRS has the following type information:
minus :: s:0 → s:0 → s:0
s :: s:0 → s:0
pred :: s:0 → s:0
0 :: s:0
le :: s:0 → s:0 → false:true
false :: false:true
true :: false:true
gcd :: s:0 → s:0 → s:0
if :: false:true → s:0 → s:0 → s:0

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

pred(v0) → null_pred [0]
if(v0, v1, v2) → null_if [0]
minus(v0, v1) → null_minus [0]
le(v0, v1) → null_le [0]
gcd(v0, v1) → null_gcd [0]

And the following fresh constants:

null_pred, null_if, null_minus, null_le, null_gcd

(6) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

minus(X, s(Y)) → pred(minus(X, Y)) [1]
minus(X, 0) → X [1]
pred(s(X)) → X [1]
le(s(X), s(Y)) → le(X, Y) [1]
le(s(X), 0) → false [1]
le(0, Y) → true [1]
gcd(0, Y) → 0 [1]
gcd(s(X), 0) → s(X) [1]
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y)) [1]
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y)) [1]
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X)) [1]
pred(v0) → null_pred [0]
if(v0, v1, v2) → null_if [0]
minus(v0, v1) → null_minus [0]
le(v0, v1) → null_le [0]
gcd(v0, v1) → null_gcd [0]

The TRS has the following type information:
minus :: s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd
s :: s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd
pred :: s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd
0 :: s:0:null_pred:null_if:null_minus:null_gcd
le :: s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd → false:true:null_le
false :: false:true:null_le
true :: false:true:null_le
gcd :: s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd
if :: false:true:null_le → s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd → s:0:null_pred:null_if:null_minus:null_gcd
null_pred :: s:0:null_pred:null_if:null_minus:null_gcd
null_if :: s:0:null_pred:null_if:null_minus:null_gcd
null_minus :: s:0:null_pred:null_if:null_minus:null_gcd
null_le :: false:true:null_le
null_gcd :: s:0:null_pred:null_if:null_minus:null_gcd

Rewrite Strategy: INNERMOST

(7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
false => 1
true => 2
null_pred => 0
null_if => 0
null_minus => 0
null_le => 0
null_gcd => 0

(8) Obligation:

Complexity RNTS consisting of the following rules:

gcd(z, z') -{ 1 }→ if(le(Y, X), 1 + X, 1 + Y) :|: z = 1 + X, Y >= 0, z' = 1 + Y, X >= 0
gcd(z, z') -{ 1 }→ 0 :|: z' = Y, Y >= 0, z = 0
gcd(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
gcd(z, z') -{ 1 }→ 1 + X :|: z = 1 + X, X >= 0, z' = 0
if(z, z', z'') -{ 1 }→ gcd(minus(X, Y), 1 + Y) :|: z = 2, z'' = 1 + Y, Y >= 0, z' = 1 + X, X >= 0
if(z, z', z'') -{ 1 }→ gcd(minus(Y, X), 1 + X) :|: z'' = 1 + Y, Y >= 0, z = 1, z' = 1 + X, X >= 0
if(z, z', z'') -{ 0 }→ 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0
le(z, z') -{ 1 }→ le(X, Y) :|: z = 1 + X, Y >= 0, z' = 1 + Y, X >= 0
le(z, z') -{ 1 }→ 2 :|: z' = Y, Y >= 0, z = 0
le(z, z') -{ 1 }→ 1 :|: z = 1 + X, X >= 0, z' = 0
le(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
minus(z, z') -{ 1 }→ X :|: X >= 0, z = X, z' = 0
minus(z, z') -{ 1 }→ pred(minus(X, Y)) :|: Y >= 0, z' = 1 + Y, X >= 0, z = X
minus(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
pred(z) -{ 1 }→ X :|: z = 1 + X, X >= 0
pred(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

Only complete derivations are relevant for the runtime complexity.

(9) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1, V2),0,[minus(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V2),0,[pred(V, Out)],[V >= 0]).
eq(start(V, V1, V2),0,[le(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V2),0,[gcd(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V2),0,[if(V, V1, V2, Out)],[V >= 0,V1 >= 0,V2 >= 0]).
eq(minus(V, V1, Out),1,[minus(X1, Y1, Ret0),pred(Ret0, Ret)],[Out = Ret,Y1 >= 0,V1 = 1 + Y1,X1 >= 0,V = X1]).
eq(minus(V, V1, Out),1,[],[Out = X2,X2 >= 0,V = X2,V1 = 0]).
eq(pred(V, Out),1,[],[Out = X3,V = 1 + X3,X3 >= 0]).
eq(le(V, V1, Out),1,[le(X4, Y2, Ret1)],[Out = Ret1,V = 1 + X4,Y2 >= 0,V1 = 1 + Y2,X4 >= 0]).
eq(le(V, V1, Out),1,[],[Out = 1,V = 1 + X5,X5 >= 0,V1 = 0]).
eq(le(V, V1, Out),1,[],[Out = 2,V1 = Y3,Y3 >= 0,V = 0]).
eq(gcd(V, V1, Out),1,[],[Out = 0,V1 = Y4,Y4 >= 0,V = 0]).
eq(gcd(V, V1, Out),1,[],[Out = 1 + X6,V = 1 + X6,X6 >= 0,V1 = 0]).
eq(gcd(V, V1, Out),1,[le(Y5, X7, Ret01),if(Ret01, 1 + X7, 1 + Y5, Ret2)],[Out = Ret2,V = 1 + X7,Y5 >= 0,V1 = 1 + Y5,X7 >= 0]).
eq(if(V, V1, V2, Out),1,[minus(X8, Y6, Ret02),gcd(Ret02, 1 + Y6, Ret3)],[Out = Ret3,V = 2,V2 = 1 + Y6,Y6 >= 0,V1 = 1 + X8,X8 >= 0]).
eq(if(V, V1, V2, Out),1,[minus(Y7, X9, Ret03),gcd(Ret03, 1 + X9, Ret4)],[Out = Ret4,V2 = 1 + Y7,Y7 >= 0,V = 1,V1 = 1 + X9,X9 >= 0]).
eq(pred(V, Out),0,[],[Out = 0,V3 >= 0,V = V3]).
eq(if(V, V1, V2, Out),0,[],[Out = 0,V4 >= 0,V2 = V5,V6 >= 0,V = V4,V1 = V6,V5 >= 0]).
eq(minus(V, V1, Out),0,[],[Out = 0,V7 >= 0,V8 >= 0,V = V7,V1 = V8]).
eq(le(V, V1, Out),0,[],[Out = 0,V9 >= 0,V10 >= 0,V = V9,V1 = V10]).
eq(gcd(V, V1, Out),0,[],[Out = 0,V11 >= 0,V12 >= 0,V = V11,V1 = V12]).
input_output_vars(minus(V,V1,Out),[V,V1],[Out]).
input_output_vars(pred(V,Out),[V],[Out]).
input_output_vars(le(V,V1,Out),[V,V1],[Out]).
input_output_vars(gcd(V,V1,Out),[V,V1],[Out]).
input_output_vars(if(V,V1,V2,Out),[V,V1,V2],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. non_recursive : [pred/2]
1. recursive [non_tail] : [minus/3]
2. recursive : [le/3]
3. recursive : [gcd/3,if/4]
4. non_recursive : [start/3]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into pred/2
1. SCC is partially evaluated into minus/3
2. SCC is partially evaluated into le/3
3. SCC is partially evaluated into gcd/3
4. SCC is partially evaluated into start/3

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations pred/2
* CE 18 is refined into CE [24]
* CE 19 is refined into CE [25]


### Cost equations --> "Loop" of pred/2
* CEs [24] --> Loop 16
* CEs [25] --> Loop 17

### Ranking functions of CR pred(V,Out)

#### Partial ranking functions of CR pred(V,Out)


### Specialization of cost equations minus/3
* CE 11 is refined into CE [26]
* CE 10 is refined into CE [27]
* CE 9 is refined into CE [28,29]


### Cost equations --> "Loop" of minus/3
* CEs [29] --> Loop 18
* CEs [28] --> Loop 19
* CEs [26] --> Loop 20
* CEs [27] --> Loop 21

### Ranking functions of CR minus(V,V1,Out)
* RF of phase [18]: [V1]
* RF of phase [19]: [V1]

#### Partial ranking functions of CR minus(V,V1,Out)
* Partial RF of phase [18]:
- RF of loop [18:1]:
V1
* Partial RF of phase [19]:
- RF of loop [19:1]:
V1


### Specialization of cost equations le/3
* CE 23 is refined into CE [30]
* CE 21 is refined into CE [31]
* CE 22 is refined into CE [32]
* CE 20 is refined into CE [33]


### Cost equations --> "Loop" of le/3
* CEs [33] --> Loop 22
* CEs [30] --> Loop 23
* CEs [31] --> Loop 24
* CEs [32] --> Loop 25

### Ranking functions of CR le(V,V1,Out)
* RF of phase [22]: [V,V1]

#### Partial ranking functions of CR le(V,V1,Out)
* Partial RF of phase [22]:
- RF of loop [22:1]:
V
V1


### Specialization of cost equations gcd/3
* CE 16 is refined into CE [34]
* CE 12 is refined into CE [35,36,37,38,39]
* CE 15 is refined into CE [40]
* CE 17 is refined into CE [41]
* CE 14 is refined into CE [42,43,44,45]
* CE 13 is refined into CE [46,47,48,49]


### Cost equations --> "Loop" of gcd/3
* CEs [49] --> Loop 26
* CEs [45] --> Loop 27
* CEs [48] --> Loop 28
* CEs [44] --> Loop 29
* CEs [42] --> Loop 30
* CEs [43] --> Loop 31
* CEs [46] --> Loop 32
* CEs [47] --> Loop 33
* CEs [35] --> Loop 34
* CEs [34] --> Loop 35
* CEs [36] --> Loop 36
* CEs [37,38,39,40,41] --> Loop 37

### Ranking functions of CR gcd(V,V1,Out)
* RF of phase [26,27]: [V+V1-3]
* RF of phase [30]: [V]

#### Partial ranking functions of CR gcd(V,V1,Out)
* Partial RF of phase [26,27]:
- RF of loop [26:1]:
V/2+V1/2-2
V1-2
- RF of loop [27:1]:
V-1 depends on loops [26:1]
V-V1+1 depends on loops [26:1]
* Partial RF of phase [30]:
- RF of loop [30:1]:
V


### Specialization of cost equations start/3
* CE 4 is refined into CE [50,51,52,53]
* CE 2 is refined into CE [54]
* CE 3 is refined into CE [55,56,57,58]
* CE 5 is refined into CE [59,60,61]
* CE 6 is refined into CE [62,63]
* CE 7 is refined into CE [64,65,66,67,68]
* CE 8 is refined into CE [69,70,71]


### Cost equations --> "Loop" of start/3
* CEs [71] --> Loop 38
* CEs [59,65,70] --> Loop 39
* CEs [50,51,52,53] --> Loop 40
* CEs [55,56,57,58] --> Loop 41
* CEs [54,60,61,62,63,64,66,67,68,69] --> Loop 42

### Ranking functions of CR start(V,V1,V2)

#### Partial ranking functions of CR start(V,V1,V2)


Computing Bounds
=====================================

#### Cost of chains of pred(V,Out):
* Chain [17]: 0
with precondition: [Out=0,V>=0]

* Chain [16]: 1
with precondition: [V=Out+1,V>=1]


#### Cost of chains of minus(V,V1,Out):
* Chain [[19],[18],21]: 3*it(18)+1
Such that:aux(1) =< V1
it(18) =< aux(1)

with precondition: [Out=0,V>=1,V1>=2]

* Chain [[19],21]: 1*it(19)+1
Such that:it(19) =< V1

with precondition: [Out=0,V>=0,V1>=1]

* Chain [[19],20]: 1*it(19)+0
Such that:it(19) =< V1

with precondition: [Out=0,V>=0,V1>=1]

* Chain [[18],21]: 2*it(18)+1
Such that:it(18) =< V1

with precondition: [V=Out+V1,V1>=1,V>=V1]

* Chain [21]: 1
with precondition: [V1=0,V=Out,V>=0]

* Chain [20]: 0
with precondition: [Out=0,V>=0,V1>=0]


#### Cost of chains of le(V,V1,Out):
* Chain [[22],25]: 1*it(22)+1
Such that:it(22) =< V

with precondition: [Out=2,V>=1,V1>=V]

* Chain [[22],24]: 1*it(22)+1
Such that:it(22) =< V1

with precondition: [Out=1,V1>=1,V>=V1+1]

* Chain [[22],23]: 1*it(22)+0
Such that:it(22) =< V1

with precondition: [Out=0,V>=1,V1>=1]

* Chain [25]: 1
with precondition: [V=0,Out=2,V1>=0]

* Chain [24]: 1
with precondition: [V1=0,Out=1,V>=1]

* Chain [23]: 0
with precondition: [Out=0,V>=0,V1>=0]


#### Cost of chains of gcd(V,V1,Out):
* Chain [[30],37]: 6*it(30)+1*s(8)+2
Such that:s(8) =< 1
aux(4) =< V
it(30) =< aux(4)

with precondition: [V1=1,Out=0,V>=1]

* Chain [[30],34]: 4*it(30)+2
Such that:it(30) =< V

with precondition: [V1=1,Out=0,V>=2]

* Chain [[30],31,37]: 4*it(30)+1*s(8)+6
Such that:s(8) =< 1
it(30) =< V

with precondition: [V1=1,Out=0,V>=2]

* Chain [[26,27],37]: 4*it(26)+4*it(27)+6*s(6)+3*s(21)+2
Such that:aux(10) =< V-V1+1
it(26) =< V/2+V1/2
aux(28) =< V
aux(29) =< V+V1
aux(30) =< V1
s(6) =< aux(29)
it(26) =< aux(29)
it(27) =< aux(29)
it(26) =< aux(30)
it(27) =< aux(30)+aux(10)
it(27) =< aux(30)+aux(28)
s(22) =< aux(30)+aux(28)
s(22) =< it(27)*aux(30)
s(21) =< s(22)

with precondition: [Out=0,V>=2,V1>=2]

* Chain [[26,27],36]: 4*it(26)+4*it(27)+3*s(19)+3*s(21)+2
Such that:aux(10) =< V-V1+1
aux(31) =< V
aux(32) =< V+V1
aux(33) =< V/2+V1/2
aux(34) =< V1
it(26) =< aux(33)
it(26) =< aux(32)
it(27) =< aux(32)
it(27) =< aux(33)
it(26) =< aux(34)
it(27) =< aux(34)+aux(10)
it(27) =< aux(34)+aux(31)
s(22) =< aux(34)+aux(31)
s(22) =< it(27)*aux(34)
s(21) =< s(22)
s(19) =< aux(32)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],33,37]: 4*it(26)+4*it(27)+1*s(8)+3*s(19)+3*s(21)+6
Such that:s(8) =< 1
aux(10) =< V-V1+1
aux(35) =< V
aux(36) =< V+V1
aux(37) =< V/2+V1/2
aux(38) =< V1
it(26) =< aux(37)
it(26) =< aux(36)
it(27) =< aux(36)
it(27) =< aux(37)
it(26) =< aux(38)
it(27) =< aux(38)+aux(10)
it(27) =< aux(38)+aux(35)
s(22) =< aux(38)+aux(35)
s(22) =< it(27)*aux(38)
s(21) =< s(22)
s(19) =< aux(36)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],32,[30],37]: 4*it(26)+4*it(27)+9*it(30)+1*s(8)+3*s(21)+6
Such that:s(8) =< 1
aux(10) =< V-V1+1
it(26) =< V/2+V1/2
aux(39) =< V
aux(40) =< V+V1
aux(41) =< V1
it(30) =< aux(40)
it(26) =< aux(40)
it(27) =< aux(40)
it(26) =< aux(41)
it(27) =< aux(41)+aux(10)
it(27) =< aux(41)+aux(39)
s(22) =< aux(41)+aux(39)
s(22) =< it(27)*aux(41)
s(21) =< s(22)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],32,[30],34]: 4*it(26)+4*it(27)+7*it(30)+3*s(21)+6
Such that:aux(10) =< V-V1+1
it(26) =< V/2+V1/2
aux(42) =< V
aux(43) =< V+V1
aux(44) =< V1
it(30) =< aux(43)
it(26) =< aux(43)
it(27) =< aux(43)
it(26) =< aux(44)
it(27) =< aux(44)+aux(10)
it(27) =< aux(44)+aux(42)
s(22) =< aux(44)+aux(42)
s(22) =< it(27)*aux(44)
s(21) =< s(22)

with precondition: [Out=0,V>=3,V1>=3,V+V1>=7]

* Chain [[26,27],32,[30],31,37]: 4*it(26)+4*it(27)+7*it(30)+1*s(8)+3*s(21)+10
Such that:s(8) =< 1
aux(10) =< V-V1+1
it(26) =< V/2+V1/2
aux(45) =< V
aux(46) =< V+V1
aux(47) =< V1
it(30) =< aux(46)
it(26) =< aux(46)
it(27) =< aux(46)
it(26) =< aux(47)
it(27) =< aux(47)+aux(10)
it(27) =< aux(47)+aux(45)
s(22) =< aux(47)+aux(45)
s(22) =< it(27)*aux(47)
s(21) =< s(22)

with precondition: [Out=0,V>=3,V1>=3,V+V1>=7]

* Chain [[26,27],32,37]: 4*it(26)+4*it(27)+5*s(6)+1*s(8)+3*s(21)+6
Such that:s(8) =< 1
aux(10) =< V-V1+1
it(26) =< V/2+V1/2
aux(48) =< V
aux(49) =< V+V1
aux(50) =< V1
s(6) =< aux(49)
it(26) =< aux(49)
it(27) =< aux(49)
it(26) =< aux(50)
it(27) =< aux(50)+aux(10)
it(27) =< aux(50)+aux(48)
s(22) =< aux(50)+aux(48)
s(22) =< it(27)*aux(50)
s(21) =< s(22)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],32,34]: 4*it(26)+4*it(27)+3*s(19)+3*s(21)+6
Such that:aux(10) =< V-V1+1
aux(51) =< V
aux(52) =< V+V1
aux(53) =< V/2+V1/2
aux(54) =< V1
it(26) =< aux(53)
it(26) =< aux(52)
it(27) =< aux(52)
it(27) =< aux(53)
it(26) =< aux(54)
it(27) =< aux(54)+aux(10)
it(27) =< aux(54)+aux(51)
s(22) =< aux(54)+aux(51)
s(22) =< it(27)*aux(54)
s(21) =< s(22)
s(19) =< aux(52)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],32,31,37]: 4*it(26)+4*it(27)+1*s(8)+3*s(19)+3*s(21)+10
Such that:s(8) =< 1
aux(10) =< V-V1+1
aux(55) =< V
aux(56) =< V+V1
aux(57) =< V/2+V1/2
aux(58) =< V1
it(26) =< aux(57)
it(26) =< aux(56)
it(27) =< aux(56)
it(27) =< aux(57)
it(26) =< aux(58)
it(27) =< aux(58)+aux(10)
it(27) =< aux(58)+aux(55)
s(22) =< aux(58)+aux(55)
s(22) =< it(27)*aux(58)
s(21) =< s(22)
s(19) =< aux(56)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=5]

* Chain [[26,27],29,37]: 4*it(26)+4*it(27)+7*s(8)+3*s(19)+3*s(21)+6
Such that:aux(10) =< V-V1+1
aux(61) =< V
aux(62) =< V+V1
aux(63) =< V/2+V1/2
aux(64) =< V1
it(26) =< aux(63)
s(8) =< aux(63)
it(26) =< aux(62)
it(27) =< aux(62)
it(27) =< aux(63)
it(26) =< aux(64)
it(27) =< aux(64)+aux(10)
it(27) =< aux(64)+aux(61)
s(22) =< aux(64)+aux(61)
s(22) =< it(27)*aux(64)
s(21) =< s(22)
s(19) =< aux(62)

with precondition: [Out=0,V>=2,V1>=2,V+V1>=6]

* Chain [[26,27],28,37]: 4*it(26)+4*it(27)+7*s(8)+3*s(19)+3*s(21)+6
Such that:aux(10) =< V-V1+1
aux(67) =< V
aux(68) =< V+V1
aux(69) =< V/2+V1/2
aux(70) =< V1
it(26) =< aux(69)
s(8) =< aux(67)
it(26) =< aux(68)
it(27) =< aux(68)
it(27) =< aux(69)
it(26) =< aux(70)
it(27) =< aux(70)+aux(10)
it(27) =< aux(70)+aux(67)
s(22) =< aux(70)+aux(67)
s(22) =< it(27)*aux(70)
s(21) =< s(22)
s(19) =< aux(68)

with precondition: [Out=0,V>=3,V1>=3,V+V1>=8]

* Chain [37]: 2*s(6)+1*s(8)+2
Such that:s(8) =< V1
aux(3) =< V
s(6) =< aux(3)

with precondition: [Out=0,V>=0,V1>=0]

* Chain [36]: 2
with precondition: [V=1,Out=0,V1>=2]

* Chain [35]: 1
with precondition: [V1=0,V=Out,V>=1]

* Chain [34]: 2
with precondition: [V1=1,Out=0,V>=1]

* Chain [33,37]: 1*s(8)+6
Such that:s(8) =< 1

with precondition: [V=1,Out=0,V1>=2]

* Chain [32,[30],37]: 6*it(30)+1*s(8)+6
Such that:s(8) =< 1
aux(4) =< V1
it(30) =< aux(4)

with precondition: [V=1,Out=0,V1>=2]

* Chain [32,[30],34]: 4*it(30)+6
Such that:it(30) =< V1

with precondition: [V=1,Out=0,V1>=3]

* Chain [32,[30],31,37]: 4*it(30)+1*s(8)+10
Such that:s(8) =< 1
it(30) =< V1

with precondition: [V=1,Out=0,V1>=3]

* Chain [32,37]: 2*s(6)+1*s(8)+6
Such that:s(8) =< 1
aux(3) =< V1
s(6) =< aux(3)

with precondition: [V=1,Out=0,V1>=2]

* Chain [32,34]: 6
with precondition: [V=1,Out=0,V1>=2]

* Chain [32,31,37]: 1*s(8)+10
Such that:s(8) =< 1

with precondition: [V=1,Out=0,V1>=2]

* Chain [31,37]: 1*s(8)+6
Such that:s(8) =< 1

with precondition: [V1=1,Out=0,V>=1]

* Chain [29,37]: 7*s(8)+6
Such that:aux(60) =< V1
s(8) =< aux(60)

with precondition: [Out=0,V1>=2,V>=V1]

* Chain [28,37]: 7*s(8)+6
Such that:aux(66) =< V
s(8) =< aux(66)

with precondition: [Out=0,V>=2,V1>=V+1]


#### Cost of chains of start(V,V1,V2):
* Chain [42]: 33*s(169)+17*s(173)+10*s(180)+44*s(181)+24*s(183)+18*s(185)+52*s(186)+20*s(187)+15*s(189)+7*s(191)+10
Such that:s(174) =< 1
s(176) =< V-V1+1
s(177) =< V+V1
s(178) =< V/2+V1/2
aux(79) =< V
aux(80) =< V1
s(173) =< aux(79)
s(169) =< aux(80)
s(180) =< s(174)
s(181) =< s(178)
s(181) =< s(177)
s(183) =< s(177)
s(183) =< s(178)
s(181) =< aux(80)
s(183) =< aux(80)+s(176)
s(183) =< aux(80)+aux(79)
s(184) =< aux(80)+aux(79)
s(184) =< s(183)*aux(80)
s(185) =< s(184)
s(186) =< s(177)
s(187) =< s(177)
s(187) =< aux(80)+s(176)
s(187) =< aux(80)+aux(79)
s(188) =< aux(80)+aux(79)
s(188) =< s(187)*aux(80)
s(189) =< s(188)
s(191) =< s(178)

with precondition: [V>=0]

* Chain [41]: 57*s(198)+44*s(199)+24*s(201)+18*s(203)+134*s(204)+20*s(205)+15*s(207)+14*s(209)+107*s(215)+44*s(223)+24*s(225)+18*s(227)+20*s(229)+15*s(231)+7*s(233)+44*s(242)+24*s(244)+18*s(246)+20*s(248)+15*s(250)+16*s(251)+12
Such that:s(237) =< -2*V1+V2+1
s(218) =< -V1+1
s(236) =< -V1+V2
s(220) =< V1/2
aux(85) =< 1
aux(86) =< V1
aux(87) =< V2
aux(88) =< V2/2
s(198) =< aux(85)
s(204) =< aux(87)
s(223) =< s(220)
s(215) =< aux(86)
s(223) =< aux(86)
s(225) =< aux(86)
s(225) =< s(220)
s(225) =< aux(86)+s(218)
s(226) =< aux(86)
s(226) =< s(225)*aux(86)
s(227) =< s(226)
s(229) =< aux(86)
s(229) =< aux(86)+s(218)
s(230) =< aux(86)
s(230) =< s(229)*aux(86)
s(231) =< s(230)
s(233) =< s(220)
s(242) =< aux(88)
s(242) =< aux(87)
s(244) =< aux(87)
s(244) =< aux(88)
s(242) =< aux(86)
s(244) =< aux(86)+s(237)
s(244) =< aux(86)+s(236)
s(245) =< aux(86)+s(236)
s(245) =< s(244)*aux(86)
s(246) =< s(245)
s(248) =< aux(87)
s(248) =< aux(86)+s(237)
s(248) =< aux(86)+s(236)
s(249) =< aux(86)+s(236)
s(249) =< s(248)*aux(86)
s(250) =< s(249)
s(251) =< s(236)
s(209) =< aux(88)
s(199) =< aux(88)
s(199) =< aux(87)
s(201) =< aux(87)
s(201) =< aux(88)
s(199) =< aux(85)
s(201) =< aux(85)+aux(87)
s(202) =< aux(85)+aux(87)
s(202) =< s(201)*aux(85)
s(203) =< s(202)
s(205) =< aux(87)
s(205) =< aux(85)+aux(87)
s(206) =< aux(85)+aux(87)
s(206) =< s(205)*aux(85)
s(207) =< s(206)

with precondition: [V=1,V1>=1,V2>=1]

* Chain [40]: 57*s(259)+44*s(260)+24*s(262)+18*s(264)+134*s(265)+20*s(266)+15*s(268)+14*s(270)+107*s(276)+44*s(284)+24*s(286)+18*s(288)+20*s(290)+15*s(292)+7*s(294)+44*s(303)+24*s(305)+18*s(307)+20*s(309)+15*s(311)+16*s(312)+12
Such that:s(298) =< V1-2*V2+1
s(297) =< V1-V2
s(279) =< -V2+1
s(281) =< V2/2
aux(93) =< 1
aux(94) =< V1
aux(95) =< V1/2
aux(96) =< V2
s(259) =< aux(93)
s(265) =< aux(94)
s(284) =< s(281)
s(276) =< aux(96)
s(284) =< aux(96)
s(286) =< aux(96)
s(286) =< s(281)
s(286) =< aux(96)+s(279)
s(287) =< aux(96)
s(287) =< s(286)*aux(96)
s(288) =< s(287)
s(290) =< aux(96)
s(290) =< aux(96)+s(279)
s(291) =< aux(96)
s(291) =< s(290)*aux(96)
s(292) =< s(291)
s(294) =< s(281)
s(303) =< aux(95)
s(303) =< aux(94)
s(305) =< aux(94)
s(305) =< aux(95)
s(303) =< aux(96)
s(305) =< aux(96)+s(298)
s(305) =< aux(96)+s(297)
s(306) =< aux(96)+s(297)
s(306) =< s(305)*aux(96)
s(307) =< s(306)
s(309) =< aux(94)
s(309) =< aux(96)+s(298)
s(309) =< aux(96)+s(297)
s(310) =< aux(96)+s(297)
s(310) =< s(309)*aux(96)
s(311) =< s(310)
s(312) =< s(297)
s(270) =< aux(95)
s(260) =< aux(95)
s(260) =< aux(94)
s(262) =< aux(94)
s(262) =< aux(95)
s(260) =< aux(93)
s(262) =< aux(93)+aux(94)
s(263) =< aux(93)+aux(94)
s(263) =< s(262)*aux(93)
s(264) =< s(263)
s(266) =< aux(94)
s(266) =< aux(93)+aux(94)
s(267) =< aux(93)+aux(94)
s(267) =< s(266)*aux(93)
s(268) =< s(267)

with precondition: [V=2,V1>=1,V2>=1]

* Chain [39]: 1
with precondition: [V1=0,V>=0]

* Chain [38]: 3*s(316)+14*s(317)+6
Such that:s(314) =< 1
s(315) =< V
s(316) =< s(314)
s(317) =< s(315)

with precondition: [V1=1,V>=1]


Closed-form bounds of start(V,V1,V2):
-------------------------------------
* Chain [42] with precondition: [V>=0]
- Upper bound: 50*V+20+nat(V1)*66+nat(V+V1)*96+nat(V/2+V1/2)*51
- Complexity: n
* Chain [41] with precondition: [V=1,V1>=1,V2>=1]
- Upper bound: 217*V1+255*V2+146+nat(-V1+V2)*49+51/2*V1+29*V2
- Complexity: n
* Chain [40] with precondition: [V=2,V1>=1,V2>=1]
- Upper bound: 255*V1+217*V2+146+nat(V1-V2)*49+29*V1+51/2*V2
- Complexity: n
* Chain [39] with precondition: [V1=0,V>=0]
- Upper bound: 1
- Complexity: constant
* Chain [38] with precondition: [V1=1,V>=1]
- Upper bound: 14*V+9
- Complexity: n

### Maximum cost of start(V,V1,V2): max([14*V+8,nat(V1)*66+19+max([nat(V+V1)*96+50*V+nat(V/2+V1/2)*51,nat(V1)*151+126+nat(V2)*217+nat(V1/2)*51+nat(V2/2)*51+max([nat(-V1+V2)*49+nat(V2)*38+nat(V2/2)*7,nat(V1-V2)*49+nat(V1)*38+nat(V1/2)*7])])])+1
Asymptotic class: n
* Total analysis performed in 887 ms.

(10) BOUNDS(1, n^1)